package buildings.iterators;

import buildings.office.OfficeBuilding;
import buildings.Floor;
import java.util.Iterator;

public class OfficeBuildingIterator implements Iterator {
    
    private OfficeBuilding officeBuilding;
    private int count;

    public OfficeBuildingIterator(OfficeBuilding  ob) {
        officeBuilding = ob;
        count = 0;
    }

    public Floor next() {
        return officeBuilding.getFloorByNumber(count++);
    }

    public boolean hasNext() {
        return officeBuilding.getFloorCount() < count;
    }

    public void remove() throws UnsupportedOperationException {
        throw new UnsupportedOperationException();
    }
}
